<template>
  <div class="print-medical">
    <header>
      <h3>{{'辉煌口腔上海路分院就诊病历'}}</h3>
    </header>
    <div class="describe">
      <div class="item">
        <div class="label">姓名:</div>
        <div class="text">{{'开心'}}</div>
      </div>
      <div class="item">
        <div class="label">性别:</div>
        <div class="text">{{'男'}}</div>
      </div>
      <div class="item">
        <div class="label">出生年月:</div>
        <div class="text">{{'1990-12-10'}}</div>
      </div>
      <div class="item">
        <div class="label">病历号:</div>
        <div class="text">{{'202206290001'}}</div>
      </div>
    </div>
    <div class="describe">
      <div class="item">
        <div class="label">就诊类型:</div>
        <div class="text">{{'初诊'}}</div>
      </div>
      <div class="item">
        <div class="label">就诊日期:</div>
        <div class="text">{{'2022-06-29'}}</div>
      </div>
      <div class="item">
        <div class="label">医生:</div>
        <div class="text">{{'张医生'}}</div>
      </div>
      <div class="item">
        <div class="label">护士:</div>
        <div class="text">{{'小刘'}}</div>
      </div>
    </div>
    <div class="medical-content">
      <div class="d-example" v-for="item in arr[0]" :key="item">
        <!-- 特殊的展示 -->
        <template v-if="item.title === '口腔检查' || item.title === '辅助检查' || item.title === '诊断' || item.title === '治疗计划' || item.title === '处置'">
          <div class="special-template">
            <div class="special-title">
              {{item.title}}:
            </div>
            <div class="special-content" >
              <div class="one-every-particular" v-for="t in item.list" :key="t">
                <!-- 左侧展示十字架 -->
                <div class="cross">
                  <div class="cross-left-top">
                      <div style="display: inline-block" v-for="v in t.Tleft" :key="v">
                          {{v.super}}
                          <div v-if="v.super" style="display: inline-block">
                            (
                            <span v-if="v.isClick === 'left'" class="supernumerary">{{v.super}}</span>
                            <span>{{v.id}}</span>
                            <span v-if="v.isClick === 'right'" class="supernumerary">{{v.super}}</span>
                            )
                          </div>
                          <div style="display: inline-block" v-else>
                            <span v-if='v.isActive'>{{v.id}}</span>
                          </div>
                          <span class="sides" v-if="v.isActive">{{v.sub}}</span>
                        </div>
                      <!-- {{t.Tleft}} -->
                  </div>
                  <div class="cross-right-top">
                      <div style="display: inline-block" v-for="v in t.Tright" :key="v">
                          {{v.super}}
                          <div v-if="v.super" style="display: inline-block">
                            (
                            <span v-if="v.isClick === 'left'" class="supernumerary">{{v.super}}</span>
                            <span>{{v.id}}</span>
                            <span v-if="v.isClick === 'right'" class="supernumerary">{{v.super}}</span>
                            )
                          </div>
                          <div style="display: inline-block" v-else>
                            <span v-if='v.isActive'>{{v.id}}</span>
                          </div>
                          <span class="sides" v-if="v.isActive">{{v.sub}}</span>
                        </div>
                  </div>
                  <div class="cross-left-bottom">
                      <div style="display: inline-block" v-for="v in t.Bleft" :key="v">
                          {{v.super}}
                          <div v-if="v.super" style="display: inline-block">
                            (
                            <span v-if="v.isClick === 'left'" class="supernumerary">{{v.super}}</span>
                            <span>{{v.id}}</span>
                            <span v-if="v.isClick === 'right'" class="supernumerary">{{v.super}}</span>
                            )
                          </div>
                          <div style="display: inline-block" v-else>
                            <span v-if='v.isActive'>{{v.id}}</span>
                          </div>
                          <span class="sides" v-if="v.isActive">{{v.sub}}</span>
                        </div>
                  </div>
                  <div class="cross-right-bottom">
                    <div style="display: inline-block" v-for="v in t.Bright" :key="v">
                          {{v.super}}
                          <div v-if="v.super" style="display: inline-block">
                            (
                            <span v-if="v.isClick === 'left'" class="supernumerary">{{v.super}}</span>
                            <span>{{v.id}}</span>
                            <span v-if="v.isClick === 'right'" class="supernumerary">{{v.super}}</span>
                            )
                          </div>
                          <div style="display: inline-block" v-else>
                            <span v-if='v.isActive'>{{v.id}}</span>
                          </div>
                          <span class="sides" v-if="v.isActive">{{v.sub}}</span>
                        </div>
                  </div>
                </div>
                <!-- 右侧文本 -->
                <div class="cross-text">
                  {{t.val}}
                </div>
              </div>
            </div>
          </div>
        </template>
        <template v-else>
          <span>{{item.title}}: </span>
          <span>{{item.content}}</span>
        </template>
      </div>
      <div class="d-example">
        
          <span>{{'相关影像'}}: </span>
          <span>

            <img v-for="i in 2" style="width: 150px; height: 100px; margin-left: 10px" src="../../assets/image/bg.png" alt="">
          </span>
      </div>
    </div>
    <div class="describe bottom-border">
      <div class="item">
        <div class="label">地址:</div>
        <div class="text">{{'江西南昌'}}</div>
      </div>
      <div class="item">
        <div class="label">联系电话:</div>
        <div class="text">{{'0000-1111-123'}}</div>
      </div>
    </div>
  </div>
</template>

<script lang="ts">
export default {
  name: 'printMedical',
  props: {
    datas: {
      type: Array
    },
    arr: {
      type: Array
    }
  },
  setup(prop:any) {
    console.log(prop.datas)
    console.log(prop.arr)
    return {
      
    }
  }
}
</script>

<style lang="scss" scoped>


  // .print-medical {
  //   header {
  //     h3 {
  //       text-align: center;
  //       font-size: 24px;
  //     }
  //   }

  //   .describe {
  //     display: flex;
  //     align-items: center;
  //     border: 2px solid transparent;
  //     border-top-color: #000;

  //     .item {
  //       flex: 1;
  //       padding: 5px 0;
  //     }
  //   }

  //   .bottom-border {
  //     border-bottom: 2px solid #000;
  //   }

  //   .medical-content {
  //     box-sizing: border-box;
  //     // padding: 0 0 0 20px;
  //     margin-bottom: 40px;

  //     .d-example {
  //       line-height: 40px;
  //       border-bottom: 1px solid $mainColor;

  //     }

  //       // 特殊
  //     .special-template {
  //       display: flex;
  //       align-items: center;
  //       .special-title {
  //         width: 100px;
  //       }
  //       .special-content {
  //         flex: 1;
  //         .one-every-particular {
  //           width: 100%;
  //           padding: 10px 15px;
  //           display: flex;
  //           align-items: center;
  //           box-sizing: border-box;
  //           .cross {
  //             min-width: 180px;
  //             line-height: 40px;
  //             display: flex;
  //             flex-wrap: wrap;

  //             .cross-left-top {
  //               width: 50%;
  //               height: 40px;
  //               border-right: 1px solid #000;
  //               border-bottom: 1px solid #000;
  //               box-sizing: border-box;
  //               text-align: right;
  //             }

  //             .cross-right-top {
  //               border-bottom: 1px solid #000;
  //               box-sizing: border-box;
  //               width: 50%;
  //               height: 40px;
  //             }

  //             .cross-left-bottom {
  //               width: 50%;
  //               height: 40px;
  //               border-right: 1px solid #000;
  //               box-sizing: border-box;
  //               text-align: right;
  //             }

  //             .cross-right-bottom {
  //               box-sizing: border-box;
  //               width: 50%;
  //               height: 40px;
  //             }


  //           }
  //           .cross-text {
  //             padding-left: 100px
  //           }
  //         }
  //       }
  //     }


  //     .supernumerary {
  //       font-size: $fontSize;
  //       transform: scale(.6);
  //       position: relative;
  //       top: -5px;
  //     }

  //   }

  // }

  // css
  .print-medical header h3 {
    text-align: center;
    font-size: 24px;
  } 
  .print-medical .describe {
    display: flex;
    align-items: center;
    border: 2px solid transparent;
    border-top-color: #000;
  }

  .print-medical .describe .item {
    flex: 1;
    padding: 5px 0;
    display: flex;
    align-items: center;
  }

  .print-medical .bottom-border {
    border-bottom: 2px solid #000;
    display: flex;
    align-items: center;
  }

  .print-medical .medical-content {
    box-sizing: border-box;
      // padding: 0 0 0 20px;
    margin-bottom: 40px;
  }

  .print-medical .medical-content .d-example {
    line-height: 40px;
    border-bottom: 1px solid $mainColor;
  }

  .print-medical .medical-content .special-template {
    display: flex;
    align-items: center;
  }

  .medical-content .special-template .special-title{
    width: 100px;
  }

  .medical-content .special-template .special-content{
    flex: 1;
  }

  .special-content .one-every-particular {
    width: 100%;
    padding: 10px 15px;
    display: flex;
    align-items: center;
    box-sizing: border-box;
  }

  .special-content .one-every-particular .cross {
    min-width: 180px;
    line-height: 40px;
    display: flex;
    flex-wrap: wrap;
  }
  .special-content .one-every-particular .cross .cross-left-top {
    width: 50%;
    height: 40px;
    border-right: 1px solid #000;
    border-bottom: 1px solid #000;
    box-sizing: border-box;
    text-align: right;
  }
  .special-content .one-every-particular .cross .cross-right-top {
    border-bottom: 1px solid #000;
    box-sizing: border-box;
    width: 50%;
    height: 40px;
  }
  .special-content .one-every-particular .cross .cross-left-bottom {
    width: 50%;
    height: 40px;
    border-right: 1px solid #000;
    box-sizing: border-box;
    text-align: right;
  }
  .special-content .one-every-particular .cross .cross-right-bottom {
    box-sizing: border-box;
    width: 50%;
    height: 40px;
  }

  .special-content .one-every-particular .cross-text {
    padding-left: 100px
  }

  .print-medical .medical-content .supernumerary {
    font-size: $fontSize;
    transform: scale(.6);
    position: relative;
    top: -5px;
  }

</style>